﻿@{
    ViewBag.WLTDataCenter = "active";
    ViewBag.Title = "数据中心";
    Layout = "~/Views/Shared/_layout_wenlvting.cshtml";
}

<div class="city_all">
    <div class="city_qs">
        <label>
            <input type="checkbox" id="inp_area_all" class="gcs-checkbox" v-on:change="check_all_click" checked> 全省
        </label>

    </div>
    <div v-for="(item,index) in lisarea" class="city_sji">
        <label><input name="city" type="checkbox" :value="item.areaId" v-model="lisaid_sel" v-on:change="check_one_change">{{item.areaName}}</label>
    </div>

</div>
<div class="timebox">
    <select v-model="bbtype">
        <option v-for="(item,index) in lisbbtype" :value="item.id">{{item.mingcheng}}</option>
    </select>
    <div class="time_choose">
        统计起始时间：
        <input type="text" id="inp_dts" placeholder="yyyy-mm-dd" class="time_hight">
        至
        <input type="text" id="inp_dte" placeholder="yyyy-mm-dd" class="time_hight">
    </div>
    <div class="time_btn"><button class="cx_btn" type="submit" v-on:click="search"> 查询</button></div>
</div>
<div class="timebox">酒店信息</div>
<div class="timebox02">
    <div class="messagebox margin20">
        <div class="message_data txtcolor_a">{{modeljdinfo.n_reg}}<span>家</span></div>
        <div class="message_type">酒店注册总数</div>
    </div>
    <div class="messagebox margin20">
        <div class="message_data txtcolor_b">{{modeljdinfo.n_room}}<span>间</span></div>
        <div class="message_type">酒店客房总数</div>
    </div>
    <div class="messagebox margin20">
        <div class="message_data txtcolor_d">{{modeljdinfo.n_star_jd}}<span>家</span></div>
        <div class="message_type">星级酒店总数</div>
    </div>
    <div class="messagebox margin20">
        <div class="message_data txtcolor_c">{{modeljdinfo.n_jingji_jd}}<span>家</span></div>
        <div class="message_type">经济型酒店总数</div>
    </div>
    <div class="messagebox margin20">
        <div class="message_data txtcolor_e">{{modeljdinfo.n_mingsu_jd}}<span>家</span></div>
        <div class="message_type">民宿总数</div>
    </div>
    <div class="messagebox margin20">
        <div class="message_data txtcolor_f">{{modeljdinfo.n_keren_jingnei}}<span>位</span></div>
        <div class="message_type">接待客人总数 (境内)</div>
    </div>
    <div class="messagebox margin20">
        <div class="message_data txtcolor_g">{{modeljdinfo.n_keren_jingwai}}<span>位</span></div>
        <div class="message_type">接待客人总数 (境外)</div>
    </div>
</div>

<div class="timebox">工作监督</div>
<div class="timebox02">
    <div class="messagebox margin20">
        <div class="message_data txtcolor_a">{{modelshenhe.n_yitijiao}}<span>份</span></div>
        <div class="message_type">已提交数据总数</div>
    </div>
    <div class="messagebox margin20">
        <div class="message_data txtcolor_b">{{modelshenhe.n_daishenhe}}<span>间</span></div>
        <div class="message_type">待审核数据总数</div>
    </div>
    <div class="messagebox margin20">
        <div class="message_data txtcolor_c">{{modelshenhe.n_yishenhe}}<span>家</span></div>
        <div class="message_type">已审核数据总数</div>
    </div>
    <div class="messagebox margin20">
        <div class="message_data txtcolor_d">{{modelshenhe.n_yichehui}}<span>家</span></div>
        <div class="message_type">已撤回数据总数</div>
    </div>
    <div class="messagebox margin20">
        <div class="message_data txtcolor_e">{{modelshenhe.sh_wanchenglv}}</div>
        <div class="message_type">审核完成率</div>
    </div>
    <div class="messagebox margin20">
        <div class="message_data txtcolor_f">{{modelshenhe.tijiaolv}}</div>
        <div class="message_type">准时提交率</div>
    </div>

</div>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            bbtype:1,
            lisbbtype:@Html.Raw(ViewBag.lisbbtype),
            lisarea:@Html.Raw(ViewBag.lisarea),
            lisaid:@Html.Raw(ViewBag.lisaid),
            lisaid_sel:@Html.Raw(ViewBag.lisaid),
            modeljdinfo: {},
            modelshenhe: {},
        },
        methods: {
            check_all_click: function () {
                if ($("#inp_area_all").is(":checked")) {
                    vm.lisaid_sel = vm.lisaid;
                }
                else {
                    vm.lisaid_sel = [];
                }
            },
            check_one_change: function () {
                vm.lisaid = vm.lisaid.sort();
                vm.lisaid_sel = vm.lisaid_sel.sort();
                if (JSON.stringify(vm.lisaid) == JSON.stringify(vm.lisaid_sel)) {
                    $("#inp_area_all").prop("checked", true);
                }
                else {
                    $("#inp_area_all").prop("checked", false);
                }
            },
            GetTongJiJDInfo: function () {
                var dts = $("#inp_dts").val();
                var dte = $("#inp_dte").val();
                $.post("/WenLvTing/GetTongJiJDInfo", { bbtype: vm.bbtype, lisaid: JSON.stringify(vm.lisaid_sel), dts: dts, dte: dte }, function (res) {
                    vm.modeljdinfo = res;
                })
            },
            GetTongJiBBZhuangTai: function () {
                var dts = $("#inp_dts").val();
                var dte = $("#inp_dte").val();
                $.post("/WenLvTing/GetTongJiBBZhuangTai", { bbtype: vm.bbtype, lisaid: JSON.stringify(vm.lisaid_sel), dts: dts, dte: dte }, function (res) {
                    vm.modelshenhe = res;
                })
            },
            search: function () {
                vm.GetTongJiJDInfo();
                vm.GetTongJiBBZhuangTai();
            }

        }
    })

    $(function () {
        vm.search();
        laydate.render({
            elem: '#inp_dts'
            , type: 'date'
        });
        laydate.render({
            elem: '#inp_dte'
            , type: 'date'
        });
    });
</script>
